package cn.wtg.kotlinlib.SingleActivityMulFragmentUi

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import cn.wtg.kotlinlib.baseUi.BaseFragment

/**
 * author: wtg
 * time: 2022/11/29
 * desc:
 */
abstract class BaseBindingBackStackFragment<B : ViewDataBinding> : BaseFragment(){
    protected var binding: B? = null
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        if (binding == null) {
            binding = DataBindingUtil.inflate(inflater, getLayoutRes(), container, false)
        }
        initView(savedInstanceState, binding!!.root)
        return binding!!.root
    }
}